package net.colah.k1.core;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.openkoala.koala.commons.domain.KoalaAbstractEntity;

/**
 * 账户
 * Created by sinclair on 4/27/14.
 */
@Entity
@Table(name = "BO_ACCOUNT")
public class Account extends KoalaAbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8450331757428873149L;
	
	private Customer customer;
	/**
	 * 开户行地址
	 */
	private String bankAddress;
	/**
	 * 银行卡号
	 */
	private String bankSN;
	/**
	 * 信用额度
	 */
	private BigDecimal credit;

	@ManyToOne
	@JoinColumn(name = "CUSTOMER_ID")
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Column(name = "BANK_SN", unique = true, length=48)
	public String getBankSN() {
		return bankSN;
	}

	public void setBankSN(String bankSN) {
		this.bankSN = bankSN;
	}

	@Column(name = "CREDIT", precision=2)
	public BigDecimal getCredit() {
		return credit;
	}

	public void setCredit(BigDecimal credit) {
		this.credit = credit;
	}

	@Column(name = "BANK_ADDRESS", unique = true, length=128)
	public String getBankAddress() {
		return bankAddress;
	}

	public void setBankAddress(String bankAddress) {
		this.bankAddress = bankAddress;
	}

	@Override
	public String[] businessKeys() {
		return new String[0];
	}
}
